<?php

class Project_Model {
	private static $_models = array();

	/**
	 * @return Project_Db_Table
	 */
	public static function get($class) {
		$class = 'Base_' . $class;
		if (empty(self::$_models[$class])) {
			self::$_models[$class] = new $class;
		}
		return self::$_models[$class];
	}

	public static function getPrimaryKeyName($class) {
		return self::get($class)->getPrimaryKeyName();
	}

	public static function getPri($class) {
		return self::getPrimaryKeyName($class);
	}

	public static function getBy($class, $attribute, $value) {
		return self::get($class)->getBy($attribute, $value);
	}

	public static function getById($class, $id) {
		return self::get($class)->getById($id);
	}
}
